import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);

export default new Router({
    routes: [
        {
            path: '',
            component: resolve => require(['../components/basicLayout/Home.vue'], resolve),
            name: 'Home',
            meta: {title: '自述文件'},
            children: [
                {
                    path: '/',
                    component: resolve => require(['../components/Dashboard.vue'], resolve),
                    meta: {title: '系统首页'}
                }, {
                    path: '/dashboard',
                    component: resolve => require(['../components/Dashboard.vue'], resolve),
                    meta: {title: '系统首页'}
                }, {
                    path: '/table',
                    component: resolve => require(['../components/common/BaseTable.vue'], resolve),
                    meta: {title: '基础表格'}
                }, {
                    path: '/message',
                    component: resolve => require(['../components/common/Message.vue'], resolve),
                    meta: {title: '消息通知'}
                }, {
                    path: '/form',
                    component: resolve => require(['../components/common/BaseForm.vue'], resolve),
                    meta: {title: '基本表单'}
                }, {
                    // 富文本编辑器组件
                    path: '/editor',
                    component: resolve => require(['../components/common/VueEditor.vue'], resolve),
                    meta: {title: '富文本编辑器'}
                },{
                    path: '/markdown',
                    component: resolve => require(['../components/common/Markdown.vue'], resolve),
                    meta: {title: 'markdown编辑器'}
                },{
                    // 图片上传组件
                    path: '/upload',
                    component: resolve => require(['../components/common/Upload.vue'], resolve),
                    meta: {title: '文件上传'}
                },{
                    path: '/charts',
                    component: resolve => require(['../components/common/BaseCharts.vue'], resolve),
                    meta: {title: 'schart图表'}
                },{
                    path: '/permission',
                    component: resolve => require(['../components/common/Permission.vue'], resolve),
                    meta: {title: '权限测试', permission: true}
                },{
                    path: '/user',
                    component: resolve => require(['../components/system/SystemUser.vue'], resolve),
                    meta: {title: '用户管理', permission: true}
                },{
                    path: '/job',
                    component: resolve => require(['../components/system/SystemJob.vue'], resolve),
                    meta: {title: '定时任务', permission: true}
                },{
                    path: '/customer',
                    component: resolve => require(['../components/system/Customer.vue'], resolve),
                    meta: {title: '客户管理', permission: true}
                },{
                    path: '/customerInfo',
                    component: resolve => require(['../components/system/CustomerInfo.vue'], resolve),
                    meta: {title: '客户详情', permission: true}
                },{
                    path: '/sysLog',
                    component: resolve => require(['../components/system/SystemLog.vue'], resolve),
                    meta: {title: '系统日志', permission: true}
                },{
                    // 系统菜单
                    path: '/sysMenu',
                    component: resolve => require(['../components/system/Menu.vue'], resolve),
                    meta: {title: '系统菜单', permission: true}
                },{
                    path: '/proxy',
                    component: resolve => require(['../components/system/Proxy.vue'], resolve),
                    meta: {title: '代理IP', permission: true}
                },{
                    path: '/role',
                    component: resolve => require(['../components/system/Role.vue'], resolve),
                    meta: {title: '角色', permission: true}
                },{
                    path: '/region',
                    component: resolve => require(['../components/system/SystemRegion.vue'], resolve),
                    meta: {title: '地区数据', permission: true}
                },{
                    path: '/userInfo',
                    component: resolve => require(['../components/system/UserInfo.vue'], resolve),
                    meta: {title: '个人设置', permission: true}
                }, {
                    path: '/feedBack',
                    component: resolve => require(['../components/system/FeedBack.vue'], resolve),
                    meta: {title: '意见反馈', permission: true}
                }, {
                    path: '/vol',
                    component: resolve => require(['../components/app/VOL.vue'], resolve),
                    meta: {title: '美图', permission: true}
                }, {
                    path: '/video',
                    component: resolve => require(['../components/app/Video.vue'], resolve),
                    meta: {title: '预告片', permission: true}
                }, {
                    path: '/article',
                    component: resolve => require(['../components/app/Article.vue'], resolve),
                    meta: {title: '文章', permission: true}
                }
            ]
        }, {
            path: '/login',
            component: resolve => require(['../components/Login.vue'], resolve)
        }, {
            path: '/404',
            component: resolve => require(['../components/404.vue'], resolve)
        },        {
            path: '/403',
            component: resolve => require(['../components/403.vue'], resolve)
        },        {
            path: '*',
            redirect: '/dashboard'
        }
    ]
})
